Hello guys,
Im almost finished with writing my own shell, but I have just one thing to finish off. Currently to get the line that the user types, I do a read(). But I want the user to be able to move the cursor to any letter, erase that letter, change that letter to anything, move to the end of the line (wtih a ctr-letter), move to the beginning of the line (with a ctr-letter), etc.
Im programming on FreeBSD. I already have experience with Termcap and I wrote my own getchar function (which doesnt wait for the user to type enter). But I dont know how to do implement all this. How would I insert a letter? Currently if I erase a letter, it will leave a blank space in the place. Should I store everything in a char * and with each movement/action work with the string?
Im really just looking for advice. No code is necessary